<?php $this->load->view('layout/header');?>
<div class="supplier-content-page">
    <div class="product-test-h5">
        <ul class="breadcrumb">
            <li><a href="javacript:;">我的账户</a></li>
            <li class="active"><a href="<?php echo site_url('accountinfo/accountRecord');?>">账户信息</a></li>
        </ul>
        <?php echo execute_alert_message();?>
        <?php $this->load->view('accountinfo/common');?>
        <div class="subject-table">
            <div class="account-record-nav">
                <a href="<?php echo site_url('accountinfo/accountRecord');?>">账户收支</a>
                <a href="<?php echo site_url('accountinfo/carryRecord');?>">提现记录</a>
                <a href="<?php echo site_url('accountinfo/rechargeRecord');?>">充值记录</a>
                <a href="<?php echo site_url('accountinfo/rebateRecord');?>" class="active">返利记录</a>
            </div>
            <?php if ($rebateRecord->num_rows() > 0) :?>
                <table class="table table-bordered">
                    <tr>
                        <th>返利单号</th>
                        <th>申请金额</th>
                        <th>抵扣金额</th>
                        <th>实际金额</th>
                        <th>申请状态</th>
                        <th>申请时间</th>
                    </tr>
                    <?php foreach ($rebateRecord->result() as $item):?>
                    <tr>
                        <td><?php echo $item->id;?></td>
                        <td><?php echo $item->o_income;?></td>
                        <td><?php echo $item->deduction;?></td>
                        <td><?php echo $item->r_income;?></td>
                        <td>
                            <?php 
                                switch (intval($item->flag)) {
                                    case 1:
                                        echo "申请中";
                                        break;
                                    case 2:
                                        echo "申请成功";
                                        break;
                                    case 4:
                                        echo "申请失败";
                                        break;    
                                }
                            ?>
                        </td>
                        <td><?php echo date('Y-m-d H:i:s', $item->date);?></td>
                    </tr>
                    <?php endforeach;?>
                </table>
                <nav><?php echo $pg_link;?></nav>
            <?php else :?>
                <div class="none-data">暂无数据</div>
            <?php endif;?>
        </div>
    </div>
</div>
<?php $this->load->view('layout/footer');?>